<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/page-base.tld" prefix="p"%>

<%String path=request.getContextPath(); %>
<script>
function immbroadcast_send(){
	var ff=$getByName("file",$w.currWinForm());
	if(ff.val()!='' && !IsExt(ff.val(),'mp3|wav')){
		$w.alertMsg("只能上传mp3或wav格式文件");
		return false;
	}
	$w.doWinForm();
}
function immbroadcast_play(file){
	playSound(file)
}
</script>
<div class="easyui-panel" data-options="doSize:false,layoutH:47,border:false" style="margin:5px">
	
		<form method="post" action="/platform/message/imm/ImmPage@sendbroadcast.page" enctype="multipart/form-data">
			<p:hidden bind="id"/>
			<p:hidden bind="new_"/>
			<div class="ui-formContent">
				<p>
					<label style="width:60px">广播内容：</label>
					<p:textarea bind="content" style="width:420px;height:120px;" styleClass="easyui-validatebox" dataOptions="required:true"/>
				</p>
				<p>
					<label style="width:60px">语音文件：</label>
					<p:switch>
					<p:case bind="lastId!=null"><span style="padding-top:5px;float:left"><a href="javascript:immbroadcast_play('<p:write bind="lastId"/>');" title="播放语音文件"><img src="<%=path %>/platform/message/icon/wmv.gif" border="0"></a></span></p:case>
					<p:else><input type="file" name="file" style="width:420px;"></p:else>
					</p:switch>
				</p>
				<p style="float:left">
					<label style="width:60px">发起人：</label>
					<span style="padding-top:5px;float:left;width:100px;"><p:write bind="userName"/></span>
				</p>
				<p style="float:left">
					<label style="width:60px">广播时间：</label>
					<span style="padding-top:5px;float:left"><p:write bind="startTime"/></span>
				</p>
	</div>
</form>
</div>
<div class="ui-buttonBar">
<p:equal bind="new_" value="true"><a href="#" class="easyui-linkbutton" iconCls="icon_save" onclick="immbroadcast_send()">保 存</a></p:equal>
	<a href="#" class="easyui-linkbutton" iconCls="icon_cancel" onclick="$w.closeCurrWin()">取 消</a>
</div>
<script>
 $("#rankgroup_tree").dynatree({
	rootVisible: false,
	checkbox: true,
	selectMode: 3,
	initAjax: { 
              url: ctx+"/platform/menu/MenuTreeShowJson.json?rankId="+$getByName("bean.rankid",$w.currWinForm()).val()
		}
});
</script>